package com.weishi.user.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.weishi.user.pojo.User;
import com.weishi.user.service.IUserService;


@Controller
@RequestMapping("/user")
public class UserController {
	@Resource
	private IUserService userService;
	
	@RequestMapping("/login")
	public String denglu(User u,Model model){
		User user =  userService.selectByUNameAndPassword(u);
		if(null!=user){
			return "FrameIndex";
		}else{
			model.addAttribute("msg", "登录失败,用户名或密码错误");
			return "login";
		}
	}
}
